<template>
  <div class="home">
    <div class="home-head" @click="headClick">
      笔记
    </div>
    <div class="home-main" @click="bottomlick">
      足迹
    </div>
  </div>
</template>
<script>
import { mapActions, mapState } from "vuex";
import { Toast } from "mint-ui";
export default {
  data() {
    return {};
  },
  filters: {
    // 返回日期格式化
    timeFun(date) {
      if (date == "") {
        return;
      } else {
        var y, m, d, h, f, s;
        var t = new Date(date);
        y = t.getFullYear();
        m = t.getMonth() + 1;
        d = t.getDate();
        h = t.getHours();
        f = t.getMinutes();
        return (
          y +
          "." +
          (m < 10 ? "0" + m : m) +
          "." +
          (d < 10 ? "0" + d : d) +
          "  " +
          (h < 10 ? "0" + h : h) +
          ":" +
          (f < 10 ? "0" + f : f)
        );
      }
    },
    numFun(val) {
      if (val == 0) {
        return val;
      } else {
        if (val) {
          return val;
        } else {
          return 0;
        }
      }
    },
    contentFun(val) {
      return val;
      //   if (val) {
      //     if (val.length > 30) {
      //       val = val.substring(0, 30);
      //       val = val + "...";
      //       return val;
      //     } else {
      //       return val;
      //     }
      //   } else {
      //     return "无";
      //   }
    },
    imgFun(val) {
      if (val) {
        return val;
      } else {
        return "/static/img/ren.png";
      }
    },
    strFun(val) {
      if (val) {
        return val;
      } else {
        return "无";
      }
    }
  },
  created: function() {
    var self = this;
  },
  beforeDestroy: function() {},
  watch: {},
  methods: {
    headClick(index) {
      this.$router.push({
        path: "/note"
      });
    },
    bottomlick(index) {
      this.$router.push({
        path: "/footprint"
      });
    },
    ...mapActions([""])
  }
};
</script>
<style scoped>
.home-head {
  border: 1px solid #ccc;
  height: 17rem;
  width: 80%;
  background-color: rgb(159, 223, 106);
  margin-top: 2rem;
  overflow: hidden;
  display: flex;
  border-radius: 5px;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  color: #000;
}
.home-main {
  margin-top: 2rem;
  border: 1px solid #ccc;
  height: 17rem;
  width: 80%;
  background-color: rgb(219, 128, 128);
  overflow: hidden;
  display: flex;
  border-radius: 5px;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  color: #000;
}

.home {
  background-color: #f7f7f7 !important;
  overflow-x: hidden;
  height: 100%;
  width: 100%;
  overflow-y: scroll;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
</style>